package com.aspose.cells;

public class DataBar {
   ConditionalFormattingValue a = null;
   ConditionalFormattingValue b = null;
   private zakp d;
   private zakp e;
   private DataBarBorder f = null;
   private NegativeBarFormat g = null;
   private int h = 10;
   private int i = 90;
   private boolean j = true;
   Workbook c;
   private FormatCondition k;
   private int l;
   private int m;
   private int n;

   zakp a() {
      return this.e;
   }

   void a(zakp var1) {
      this.e = var1;
   }

   public Color getAxisColor() {
      return this.e.b(this.c);
   }

   public void setAxisColor(Color value) {
      this.e.a(2, value.toArgb());
   }

   public int getAxisPosition() {
      return this.l;
   }

   public void setAxisPosition(int value) {
      this.l = value;
   }

   public int getBarFillType() {
      return this.m;
   }

   public void setBarFillType(int value) {
      this.m = value;
   }

   public int getDirection() {
      return this.n;
   }

   public void setDirection(int value) {
      this.n = value;
   }

   public DataBarBorder getBarBorder() {
      return this.f;
   }

   public NegativeBarFormat getNegativeBarFormat() {
      return this.g;
   }

   DataBar(Workbook workbook, FormatCondition fmtCond) {
      this.k = fmtCond;
      this.c = workbook;
      this.d = new zakp(false);
      this.e = new zakp(false);
      this.f = new DataBarBorder(this);
      this.g = new NegativeBarFormat(this);
      zakp var3 = new zakp(false);
      this.getBarBorder().a(var3);
      this.getBarBorder().setType(0);
      zakp var4 = new zakp(false);
      var4.a(2, 0);
      this.a(var4);
      this.setAxisPosition(2);
      this.setBarFillType(1);
      this.setDirection(0);
   }

   void a(DataBar var1, CopyOptions var2, int var3, int var4) {
      this.h = var1.h;
      this.j = var1.j;
      this.i = var1.i;
      if (var1.b != null) {
         this.b = new ConditionalFormattingValue(this.k);
         this.b.a(var1.b, var1.c.getWorksheets(), this.c.getWorksheets(), var2, var3, var4);
      }

      if (var1.a != null) {
         this.a = new ConditionalFormattingValue(this.k);
         this.a.a(var1.a, var1.c.getWorksheets(), this.c.getWorksheets(), var2, var3, var4);
      }

      this.d.f(var1.d);
      this.e.f(var1.e);
      this.l = var1.l;
      this.m = var1.m;
      this.n = var1.n;
      if (var1.f != null) {
         this.f = new DataBarBorder(this);
         this.f.a(var1.f);
      }

      if (var1.g != null) {
         this.g = new NegativeBarFormat(this);
         this.g.a(var1.g);
      }

   }

   static DataBar a(Workbook var0, FormatCondition var1) {
      DataBar var2 = new DataBar(var0, var1);
      var2.a = new ConditionalFormattingValue(var1, 7, (Object)null);
      var2.b = new ConditionalFormattingValue(var1, 6, (Object)null);
      zakp var3 = new zakp(false);
      var3.a(2, zase.s("FF638EC6"));
      var2.b(var3);
      var2.c = var0;
      zakp var4 = new zakp(false);
      var2.getBarBorder().a(var4);
      var2.getBarBorder().setType(0);
      zakp var5 = new zakp(false);
      var5.a(2, 0);
      var2.a(var5);
      var2.setAxisPosition(0);
      var2.setBarFillType(0);
      var2.setDirection(0);
      return var2;
   }

   public ConditionalFormattingValue getMinCfvo() {
      if (this.a == null) {
         this.a = new ConditionalFormattingValue(this.k, 2, (Object)null);
      }

      return this.a;
   }

   public ConditionalFormattingValue getMaxCfvo() {
      if (this.b == null) {
         this.b = new ConditionalFormattingValue(this.k, 1, (Object)null);
      }

      return this.b;
   }

   void a(ConditionalFormattingValue var1) {
      this.b = var1;
   }

   void b(ConditionalFormattingValue var1) {
      this.a = var1;
   }

   public Color getColor() {
      return this.d.b(this.c);
   }

   public void setColor(Color value) {
      this.d.a(2, value.toArgb());
   }

   zakp b() {
      return this.d;
   }

   void b(zakp var1) {
      this.d = var1;
   }

   public int getMinLength() {
      return this.h;
   }

   public void setMinLength(int value) {
      this.h = value;
   }

   public int getMaxLength() {
      return this.i;
   }

   public void setMaxLength(int value) {
      this.i = value;
   }

   public boolean getShowValue() {
      return this.j;
   }

   public void setShowValue(boolean value) {
      this.j = value;
   }

   public byte[] toImage(Cell cell, ImageOrPrintOptions imgOpts) throws Exception {
      zaay var3 = zka.a(this.k.a.e);
      var3.a = 5;
      var3.f = this.k;
      var3.g = cell.getRow();
      var3.h = (short)cell.getColumn();
      FormatConditionCollection var4 = this.k.a;
      CellArea var5 = new CellArea();

      for(int var6 = 0; var6 < var4.b.size(); ++var6) {
         var5 = (CellArea)var4.b.get(var6);
         if (var5.a(var3.g, var3.h)) {
            break;
         }
      }

      znn var13 = new znn(this, var3, cell.c, var5);
      float var7 = (float)cell.d.getColumnWidthInch(cell.getColumn()) * 72.0F;
      float var8 = (float)cell.d.getRowHeightInch(cell.getRow()) * 72.0F;
      com.aspose.cells.b.a.b.zq var9 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var7, var8);
      com.aspose.cells.a.d.zb var10 = new com.aspose.cells.a.d.zb();
      com.aspose.cells.a.d.zb var11 = var13.a(var9, new double[]{1.0D, 1.0D}, 5, 0);
      var10.a((com.aspose.cells.a.d.zl)var11);
      com.aspose.cells.b.a.d.zh var12 = new com.aspose.cells.b.a.d.zh();
      zbuk.a(var12, var10, imgOpts, (int)(var7 * (float)this.c.getWorksheets().L() / 72.0F), (int)(var8 * (float)this.c.getWorksheets().M() / 72.0F));
      return var12.o();
   }
}
